package com.contextor.cards.shell.services
{
	import mx.rpc.AsyncToken;

	public class AsyncTokenInfo
	{
		public var token:AsyncToken;
		public var operationName:String;
		public var operationArgs:Object;
		public var startTime:Date;
		
		public function AsyncTokenInfo(token:AsyncToken, operationName:String = "", operationArgs:Object = null, startTime:Date = null)
		{
			this.token = token;
			this.operationName = operationName;
			this.operationArgs = operationArgs;
			this.startTime = (startTime) ? startTime : new Date();
		}
		
		public function getElapsedTime():uint
		{
			return ((new Date()).time - startTime.time);
		}
	}
}